﻿namespace TCPBaseModbusTCP.Models
{
    public class TcpClientSetting
    {
        public string ServerIp { get; set; } = "127.0.0.1";
        public int ServerPort { get; set; } = 502;
        public string ClientId { get; set; } = $"CLIENT-{Guid.NewGuid():N}";
        public int ReconnectIntervalMs { get; set; } = 5000;
        public int ReceiveBufferSize { get; set; } = 2048; // 适配Modbus数据长度
    }
    /// <summary>
    /// 接收的网关数据（Modbus格式）
    /// </summary>
    public class ReceivedGatewayData
    {
        public DateTime Timestamp { get; set; } = DateTime.Now;
        public string GatewayId { get; set; } = string.Empty;
        public ModbusTcpPacket? ModbusPacket { get; set; } // 解析后的Modbus数据包
        public byte[] RawData { get; set; } = Array.Empty<byte>(); // 原始字节数据
    }
}
